package com.siebre.picclife.asynctask.utils;

import java.lang.reflect.Method;

import com.siebre.picclife.asynctask.annotation.TaskMapping;

/**
 * 
 * @author ZhangChi
 * @since 2015年4月14日
 *
 */
public final class TaskMappingUtils {

	private TaskMappingUtils() {
	}

	public static String resolveTaskType(Method method) {
		TaskMapping taskMapping = method.getAnnotation(TaskMapping.class);
		return taskMapping == null ? String.format("%s-%s", method.getDeclaringClass().getSimpleName(), method.getName()) : taskMapping.type();
	}
}
